Ext.onReady(function(){
	
    var tabs = new Ext.TabPanel({
    	id:'tab',
        renderTo: 'tabPages',
        activeTab: 0,
        width:1140,
        height:1000,
        bodyStyle:'padding:10px;',
        plain:true,
        defaults:{autoScroll: true},
        items:[{
                title: '<table width="100"><tr><td rowspan="2"><img src="images/next.png" width="32"/></td><td>新增版本:</td></tr><tr><td>定量因素</td></tr></table>',

                html:'<iframe src="view/model/AddRatio.jsp" frameborder="0" width="100%" height="100%"></iframe>'
            },{
                title: '<table width="100"><tr><td rowspan="2" text-align="right"><img src="images/next.png" width="32"/></td><td>新增版本:</td></tr><tr><td>定性因素</td></tr></table>',
                html: '<iframe src="view/model/AddQua.jsp" frameborder="0" width="100%" height="100%"></iframe>'
            },{
                title: '<table width="100"><tr><td rowspan="2"><img src="images/next.png" width="32"/></td><td>新增版本:</td></tr><tr><td>调整项</td></tr></table>',
                listeners: {activate: handleActivate},
                html: '<iframe src="view/model/AddAdjustment.jsp" frameborder="0" width="100%" height="100%"></iframe>'
            },{
                title: '<table width="100"><tr><td rowspan="2"><img src="images/next.png" width="32"/></td><td>新增版本:</td></tr><tr><td>校准信息</td></tr></table>',
                html: '<iframe src="view/model/ModelLevel.jsp" frameborder="0" width="100%" height="100%"></iframe>'
            }
        ]
    });
    
function test(node){


var tb = Ext.getCmp("tab");


 var newtbid = "t_"+node.id;

 var newtb = tb.getComponent(newtbid);

 if(newtb){
  tb.setActiveTab(newtb);
 }
 else
 {

//实现链接的动态获取
  var url = (node.attributes.href)+"?node="+node.id;//获取tree中的href

  newtb = new Ext.Panel({
   title:node.text,
   closable:true,
   id:newtbid,
   itemId:newtbid,
   autoLoad:'view/rating/CustomerRating_FirstPD.jsp'     //加载页面到tab标签中
  });

//加载新tab标签到tabpanel中并激活显示
  tb.setActiveTab(tb.add(newtb));
 }

}

    function handleActivate(tab){
    	var currentTitle = tab.title;
        //alert(currentTitle + ' was activated.');
        //tab.setTitle('cc'+currentTitle);
    }
});